<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>   
<c:set var="ctx" value="${pageContext.request.contextPath }" ></c:set> 
<!Doctype html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>登录界面</title>
    <link rel="stylesheet" href="${ctx }/css/bootstrap.css" />
    <link href="${ctx }/assets/css/dashboard.css" rel="stylesheet" />
    
    <script type="text/javascript" src="${ctx }/js/jquery-1.11.1.js" ></script>
    <script type="text/javascript" src="${ctx }/js/bootstrap.js" ></script>
    <script type="text/javascript" src="${ctx }/js/boostrap-show-password.js" ></script>
    <script type="text/javascript">
    	function toLogin(){
    		var f = $('#userForm');
    		var data = f.serialize();
    		$.ajax({
    			type:'post',
    			url:'${ctx}/ic/toLogin',
    			data:data,
    			dataType:'json',
    			success:function(result){
    				if(result.sus){
    					alert();
    					window.location.href='${ctx}/ic/index'
    				}else{
    					alert(result.msg);
    				}
    			}
    			
    		});
    	}
    </script>
  </head>
  <body class="">
    <div class="page">
      <div class="page-single">
        <div class="container">
          <div class="row">
            <div class="col col-login mx-auto">
              <div class="text-center mb-6">
                <img src="${ctx }/img/logo/subway.svg" class="h-6" alt="LeaseCenter logo">
                	<span style="font-size: 18px;font-weight: bold;">租赁中心登录界面</span>
              </div>
              <form class="card" action="" method="post" id="userForm">
                <div class="card-body p-6">
                  <div class="card-title">登录你的账号</div>
                  <div class="form-group">
                    <label class="form-label">登录名</label>
                    <input type="text" class="form-control" name="loginName" id=""  placeholder="输入账号">
                  </div>
                  <div class="form-group">
                    <label class="form-label">
                      	密码
                      <a href="./forgot-password.html" class="float-right small">忘记密码?</a>
                    </label>
                    <input type="password" class="form-control" id="" name="password" placeholder="密码" data-toggle="password">
                  </div>
                  <div class="form-group">
                    <label class="custom-control custom-checkbox">
                      <input type="checkbox" class="custom-control-input" />
                      <span class="custom-control-label">记住账号</span>
                    </label>
                  </div>
                  <div class="form-footer">
                    <button type="button" class="btn btn-primary btn-block" onclick="toLogin()">登录</button>
                  </div>
                </div>
              </form>
              <div class="text-center text-muted">
                	没有账号? <a href="${ctx }/ic/register">点击注册</a>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </body>
</html>